package com.forte.shoppingcustomerdao;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

import com.forte.cartdao.Cart;

@Entity(name="shoppingcustomer")
public class ShoppingCustomer  implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name="customerId")
	private int customerId;
	
	@Column(name="customerUniqueId")
	private String customerUniqueId;
	
	@Column(name="firstName")
	private String firstName;
	
	@Column(name="lastName")
	private String lastName;
	
	@Column(name="emailAddress")
	private String email;
	
	@Column(name="password")
	private String password;
	
	@Column(name="createdDate")
	private Date createdDate;
	
	@OneToMany(cascade = CascadeType.ALL)
	public List<Address> address = new ArrayList<Address>();
	
	@OneToOne
	//@PrimaryKeyJoinColumn
	@JoinColumn(name="customerId",insertable=false, updatable=false)
	private Cart cart;

	public int getCustomerId() {
		return customerId;
	}

	public void setCustomerId(int customerId) {
		this.customerId = customerId;
	}

	public String getCustomerUniqueId() {
		return customerUniqueId;
	}

	public void setCustomerUniqueId(String customerUniqueId) {
		this.customerUniqueId = customerUniqueId;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
	
	public List<Address> getAddress(){
		return address;
	}
	
	public Cart getCart(){
		return cart;
	}
}
